package com.example.chat.model;

import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author pq
 * @date 2022/8/14 0:13
 * @description 用户聊天记录
 * @modified
 **/
@Entity
@Data
@DynamicUpdate
@DynamicInsert
@Table(name = "chat_record")
public class ChatRecords extends BaseEntity implements Serializable {

    /**
     * 主键
     */
    @Id
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "uuid")
    @Column(name = "id", nullable = false)
    private String id;

    /**
     * 聊天信息
     */
    @Column(name = "chat_message")
    private String chatMessage;

    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    /**
     * 创建人id
     */
    @Column(name = "create_user_id", nullable = false)
    private String createUserId;
}
